<extend name="Index/index" />
<block name="center">
<div class="col-lg-12" style="padding-left:0px;padding-right:0px;">
    <div class="portlet box portlet-blue" >
        <div class="portlet-header">
            <div class="caption">修改产品</div>
        </div>
        <div class="portlet-body">
            <form class="form-horizontal" role="form" action="{:U('Admin/Foods/Update')}" method="post" enctype="multipart/form-data" >
                <div class="row">
                    <div class="col-md-6" style="width:700px">
                        <div class="form-group">
                            <label class="col-md-3 control-label" >产品名称</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" value="{$info[0]['name']}" name="name" id="fname">
                                <input type="hidden" value="{$info[0]['id']}" name="id" >
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label" >产品价格</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" value="{$info[0]['price']}" name="price" id="price">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label" >上架的时间</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" value="{:date('Y-m-d H:i:s',$info[0]['addtime'])}" name="addtime" id="price" disabled="disabled" class="form-control">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label">所属分类</label>
                            <div class="col-md-9">
                                <select class="form-control" name="cid">
                                    <foreach name="cinfo" item="vo">
                                        <option value="{$vo['id']}" 
                                            <if condition="$vo['id'] eq $info[0]['cid'] ">selected</if>
                                        >{$vo['cname']}</option>
                                    </foreach>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label">产品的状态</label>
                            <div class="col-md-9">
                                <select class="form-control" name="fstatus">
                                        <option value="1" <if condition="$info[0]['fstatus'] eq 1">selected</if>>在售卖</option>
                                        <option value="0" <if condition="$info[0]['fstatus'] eq 0">selected</if>>已下架</option>
                                    
                                </select>
                            </div>
                        </div>    
                        <div class="form-group">
                            <label class="col-md-3 control-label" >起批量</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" value="{$info[0]['number']}" name="number" id="number">
                            </div>
                        </div>  
                        <div class="form-group">
                            <label class="col-md-3 control-label" >规格</label>
                            <div class="col-md-9">
                                <input type="text" class="form-control" value="{$info[0]['Specifications']}" name="Specifications" id="Specifications">
                            </div>
                        </div>   
                    
                        <div class="form-group">
                            <label class="col-md-3 control-label" for="exampleInputFile">产品图片</label>
                            <div class="col-md-9">
                                <div style="float:left">
                                <input type="file" id="exampleInputFile" name="fpic">
                                <p class="help-block">请上传格式为:jpg png jpeg...的图片</p>
                                </div>
                                <div style="float:left;margin-left:30px">
                                <img src="/MVP/{$info[0]['fpic']}" alt="" width="100px">
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-3 control-label">产品描述</label>
                            <div class="col-md-9">
                                <textarea class="form-control" rows="3" name="fcontent">{$info[0]['fcontent']}</textarea>
                            </div>
                        </div>
                        <div class="form-group">
                            
                           <div class="form-actions">
                                <div class="col-md-offset-3 col-md-9">
                                    <button type="submit" class="btn btn-primary">修改</button>&nbsp;
                                    <button type="reset" class="btn btn-green">重置</button>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>
        
</block>